TYRO.BaseIClient Class
A mixin used by both versions of the iClient. We'd hide this but yuidoc doesn't make that easy. See in the TYRO module description.
Item Index
Methods
addTip
-
completionReference -
tipAmount -
responseReceivedCallback
Add a tip to a previous purchase (initiatePurchase).
Parameters:
-
completionReferenceStringTransaction identifier from the original transaction.
-
tipAmountStringThe tip amount to add in cents.
-
responseReceivedCallbackFunctionInvoked to indicate success or failure. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.
Example:
// to add a $3.00 tip to a transaction with completion reference 543123
iclient.addTip("543123", "300", yourPosCode.handleResponse);
closeTab
-
completionReference -
amount -
responseReceivedCallback
Close a previously opened bar tab (initiateOpenTab) with a final amount. The customer will be charged.
Parameters:
-
completionReferenceStringTransaction identifier from the original transaction.
-
amountStringThe final amount to charge the customer.
-
responseReceivedCallbackFunctionInvoked to indicate success or failure. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.
Example:
// to close the tab with completion reference 543123 and bill a customer $120.01
iclient.closeTab("543123", "12001", yourPosCode.handleResponse);
completePreAuth
-
requestParams -
responseReceivedCallback
Close a previously opened preAuth (initiateOpenPreAuth) with a final amount. The customer will be charged.
Parameters:
-
requestParamsObjectAn object containing the following properties:
-
completionReferenceStringTransaction identifier from the original transaction.
-
amountStringThe final amount to charge the customer.
-
[integrationKey]String optionalSupply the integration key if your browser does not support local storage.
-
[mid]Int optionalOverride the configured mid for multi-merchant terminals.
-
[tid]Int optionalOverride the configured tid for multi-merchant terminals.
-
-
responseReceivedCallbackFunctionInvoked to indicate success or failure. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.
Example:
// to close the preAuth with completion reference 543123 and bill a customer $120.01
iclient.completePreAuth({amount: "12001", completionReference: "543123"}, yourPosCode.handleResponse);
healthpointReconciliationReport
-
requestParams -
responseReceivedCallback
Retrieve a payments or claims HealthPoint reconciliation report.
Parameters:
-
requestParamsObjectAn object containing the following properties:
-
reconDateStringThe reporting date in format yyyyMMdd.
-
reportTypeStringThe report type. Valid values are payments and claims.
-
integrationKeyStringSupply the integration key if your browser does not support local storage.
-
-
responseReceivedCallbackFunctionCallback to return the report or error message. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.dataString
The report in xml format.errorString
An error message to show the merchant. Only present when result is failure.
Example:
// to retrieve the HealthPoint payments report for 25th December 2012
iclient.healthpointReconciliationReport({
reportType: "payments",
reconDate "20121225"
}, yourPosCode.handleResponse);
manualSettlement
-
responseReceivedCallback -
options
Manually settle the terminal: close off reporting for the day.
Parameters:
-
responseReceivedCallbackFunctionCalled with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.currentTerminalBusinessDayString
Current reporting day after settlement request. Only returned if result is success. Format dd/MM/yyyy.
-
optionsObjectAn object containing the following properties:
-
[mid]Int optionalOverride the configured mid for multi-merchant terminals or if your browser does not support local storage.
-
[tid]Int optionalOverride the configured tid for multi-merchant terminals or if your browser does not support local storage.
-
[integrationKey]String optionalSupply the integration key if your browser does not support local storage.
-
Example:
// to close the current reporting day
iclient.manualSettlement(yourPosCode.handleResponse);
reconciliationReport
-
requestParams -
responseReceivedCallback
Retrieve a summary or detail reconciliation report.
Parameters:
-
requestParamsObjectAn object containing the following properties:
-
terminalBusinessDayStringThe reporting date in format yyyyMMdd.
-
typeStringThe report type. Valid values are summary and detail.
-
formatStringThe report format. Valid values are txt and xml. The txt version is pre-formatted in a monospaced font.
-
[integrationKey]String optionalSupply the integration key if your browser does not support local storage.
-
[mid]Int optionalOverride the configured mid for multi-merchant terminals.
-
[tid]Int optionalOverride the configured tid for multi-merchant terminals.
-
-
responseReceivedCallbackFunctionCallback to return the report or error message. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.formatString
The request parameter format is passed back for convenience.typeString
The request parameter type is passed back for convenience.dataString
The report. Pre-formatted text when format is txt. Parsable xml when format xml.errorString
An error message to show the merchant. Only present when result is failure.
Example:
// to retrieve the pre-formatted detail report for 25th December 2012
iclient.reconciliationReport({
type: "detail",
terminalBusinessDay "20121225"
format: "txt"
}, yourPosCode.handleResponse);
voidPreAuth
-
requestParams -
responseReceivedCallback
Void a previously opened preAuth (initiateOpenPreAuth). This discards the hold on funds in the customer's account.
Parameters:
-
requestParamsObjectAn object containing the following properties:
-
completionReferenceStringTransaction identifier from the original transaction.
-
[integrationKey]String optionalSupply the integration key if your browser does not support local storage.
-
[mid]Int optionalOverride the configured mid for multi-merchant terminals.
-
[tid]Int optionalOverride the configured tid for multi-merchant terminals.
-
-
responseReceivedCallbackFunctionInvoked to indicate success or failure. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.
Example:
// to void a preAuth with completion reference 543123
iclient.voidPreAuth({completionReference: "543123"}, yourPosCode.handleResponse);
voidTab
-
completionReference -
responseReceivedCallback
Void a previously opened bar tab (initiateOpenTab). This discards the hold on funds in the customer's account.
Parameters:
-
completionReferenceStringTransaction identifier from the original transaction.
-
responseReceivedCallbackFunctionInvoked to indicate success or failure. Called with a single Object containing the following properties:
resultString
One of the following values: success, failure.messageString
Message to show the merchant.
Example:
// to void a bar tab with completion reference 543123
iclient.voidTab("543123", yourPosCode.handleResponse);
